package com.fortune.dao;


import com.fortune.dto.in.dStoreSurplus.DStoreSurplusAddDto;
import com.fortune.dto.in.dStoreSurplus.DStoreSurplusEditDto;
import com.fortune.dto.in.dStoreSurplus.DStoreSurplusInfoDto;
import com.fortune.dto.in.dStoreSurplus.DStoreSurplusListDto;
import com.fortune.vo.dStoreSurplus.DStoreSurplusInfo;
import com.fortune.vo.dStoreSurplus.DStoreSurplusInfoDetail;
import com.fortune.vo.dStoreSurplus.DStoreSurplusInfoList;
import com.fortune.vo.mStoreSurplus.StockDetailSurplus;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface DStoreSurplusDao {

    int findNumIsNull(@Param("num") String num);

    /**
     * 新增报盈单base
     * @param companyId
     * @param uuid
     * @param uid
     * @param addDto
     * @return
     */
    int addSurplusBase(@Param("dealerId") String dealerId, @Param("uuid") String uuid, @Param("uid") String uid, @Param("addDto") DStoreSurplusAddDto addDto);


    /**
     * 新增报盈单商品
     * @param uuid
     * @param infoDto
     * @return
     */
    int addSurplusDetail(@Param("dealerId") String dealerId, @Param("uuid") String uuid, @Param("infoDto") DStoreSurplusInfoDto infoDto);


    /**
     * 查询报盈列表
     * @return
     */
    List<DStoreSurplusInfo> findDealerSurplusList(@Param("dealerId") String dealerId, @Param("dStoreSurplusListDto") DStoreSurplusListDto dStoreSurplusListDto);


    /**
     * 查询报盈列表数量
     * @param dStoreSurplusListDto
     * @return
     */
    int findDealerSurplusListCount(@Param("dealerId") String dealerId, @Param("dStoreSurplusListDto") DStoreSurplusListDto dStoreSurplusListDto);


    /**
     * 查看报盈商品详情
     * @param deficitId
     * @return
     */
    DStoreSurplusInfoDetail findDealerIdSurplusInfo(@Param("dealerId") String dealerId, @Param("deficitId") String deficitId);

    DStoreSurplusInfoList findJXSname(@Param("mid")String mid);

    /**
     * 确认入库
     * @param companyId
     * @param dealerId
     * @param uuid
     * @return
     */
    int editDStoreSurplusConfirm(@Param("dealerId")String dealerId,@Param("operatorId") String operatorId, @Param("uuid") String uuid);

    /**
     * 删除
     * @param companyId
     * @param dealerId
     * @param uuid
     * @return
     */
    int deleteDStoreSurplus(@Param("dealerId")String dealerId, @Param("uuid") String uuid);


    /**
     * 编辑报亏单base
     * @param companyId
     * @param addDto
     * @return
     */
    int editSurplusBase(@Param("dealerId") String dealerId, @Param("editDto") DStoreSurplusEditDto editDto);

    /**
     * 删除商品详情
     * @param companyId
     * @param dealerId
     * @param uuid
     * @return
     */
    int deleteInfo(@Param("dealerId")String dealerId, @Param("uuid") String uuid);

    DStoreSurplusAddDto findData(@Param("did")String did,@Param("id")String id);

    StockDetailSurplus findProductStock(@Param("did")String did, @Param("storeId")String storeId, @Param("proId")String proId,@Param("mid")String mid);

    int addProDuctStock(@Param("did")String did, @Param("storeId")String storeId, @Param("proId")String proId, @Param("no")int no, @Param("id")String id, @Param("sNo")int sNo, @Param("num")BigDecimal num, @Param("rainNum")float rainNum,@Param("mid")String mid);
}
